function setImageSrc(src,eid){
    $(eid).attr('src',src);
    $(eid).parent().nailthumb();
}
function marquee(){
   $('.marquee').each(function(){
        if($(this.parentNode).prop("tagName")==='marquee')$(this).unwrap();
	if($(this).width()>$(this.parentNode).width() || $(this).height()>$(this.parentNode).height()){
            $(this).wrap('<marquee></marquee>');
	}
    }); 
}
$(document).ready(function() {
//    marquee();
//    $(window).resize(marquee);
    $('.list-news p').hover(function(){
        $('.list-news p.active').removeClass('active');
        var $thumb =$(this).data('thumb');
        if($(this.parentNode).prev().find('img').attr('src')!==$thumb){
            $(this.parentNode).prev().find('img').attr('src',$thumb).parent().nailthumb();
        }
        $(this).addClass('active');
    },function(){
        //$(this).removeClass('active');
    });
    $('.char').click(function(){
       if(!$(this).hasClass('active')){
           $('.char.active').removeClass('active');//.stop().animate({width:'10.746606334%'},500);
           $(this).addClass('active');//.stop().animate({width:'57.013574660%'},500);
       }
    });
    if ($('#royalSliderTop').length > 0)
        try {
            $('#royalSliderTop').royalSlider({
                arrowsNav: true,
                loop: false,
                keyboardNavEnabled: true,
                controlsInside: false,
                imageScaleMode: 'fill',
                arrowsNavAutoHide: false,
                autoScaleSlider: true,
                autoScaleSliderWidth: 575,
                autoScaleSliderHeight: 232,
                controlNavigation: 'bullets',
                thumbsFitInViewport: false,
                //slidesOrientation: 'vertical',
                navigateByClick: true,
                startSlideId: 0,
                autoPlay: {
                    // autoplay options go gere
                    enabled: true,
                    pauseOnHover: true,
                    delay: 3000
                },
                transitionType: 'move',
                globalCaption: true,
                deeplinking: {
                    enabled: true,
                    change: false
                },
                /* size of all images http://help.dimsemenov.com/kb/royalslider-jquery-plugin-faq/adding-width-and-height-properties-to-images */
                imgWidth: 575,
                imgHeight: 232
            });
        } catch (e) {
        }

    if ($('#royalGalleryGrid').length > 0)
        try {
            $('#royalGalleryGrid').royalSlider({
                autoHeight: true,
                arrowsNav: false,
                fadeinLoadedSlide: false,
                controlNavigationSpacing: 0,
                controlNavigation: 'tabs',
                imageScaleMode: 'none',
                imageAlignCenter: false,
                loop: true,
                loopRewind: true,
                numImagesToPreload: 6,
                keyboardNavEnabled: true,
                usePreloader: false
            });
        } catch (e) {
        }

    //<<<---START GALLERY PHOTO
    if ($('#GalleryPhoto').length > 0)
        try {
            var _SlideshowTransitions = [
                //Zoom- in
                {$Duration: 1200, $Zoom: 1, $Easing: {$Zoom: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseOutQuad}, $Opacity: 2},
                //Zoom+ out
                {$Duration: 1000, $Zoom: 11, $SlideOut: true, $Easing: {$Zoom: $JssorEasing$.$EaseInExpo, $Opacity: $JssorEasing$.$EaseLinear}, $Opacity: 2},
                //Rotate Zoom- in
                {$Duration: 1200, $Zoom: 1, $Rotate: true, $During: {$Zoom: [0.2, 0.8], $Rotate: [0.2, 0.8]}, $Easing: {$Zoom: $JssorEasing$.$EaseSwing, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseSwing}, $Opacity: 2, $Round: {$Rotate: 0.5}},
                //Rotate Zoom+ out
                {$Duration: 1000, $Zoom: 11, $Rotate: true, $SlideOut: true, $Easing: {$Zoom: $JssorEasing$.$EaseInExpo, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInExpo}, $Opacity: 2, $Round: {$Rotate: 0.8}},
                //Zoom HDouble- in
                {$Duration: 1200, $Cols: 2, $Zoom: 1, $FlyDirection: 1, $Assembly: 2049, $ChessMode: {$Column: 15}, $Easing: {$Left: $JssorEasing$.$EaseInCubic, $Zoom: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseLinear}, $ScaleHorizontal: 0.5, $Opacity: 2},
                //Zoom HDouble+ out
                {$Duration: 1200, $Cols: 2, $Zoom: 11, $SlideOut: true, $FlyDirection: 1, $Assembly: 2049, $ChessMode: {$Column: 15}, $Easing: {$Left: $JssorEasing$.$EaseInExpo, $Zoom: $JssorEasing$.$EaseInExpo, $Opacity: $JssorEasing$.$EaseLinear}, $ScaleHorizontal: 4, $Opacity: 2},
                //Rotate Zoom- in L
                {$Duration: 1200, $Zoom: 1, $Rotate: true, $During: {$Left: [0.2, 0.8], $Zoom: [0.2, 0.8], $Rotate: [0.2, 0.8]}, $FlyDirection: 1, $Easing: {$Left: $JssorEasing$.$EaseSwing, $Zoom: $JssorEasing$.$EaseSwing, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseSwing}, $ScaleHorizontal: 0.6, $Opacity: 2, $Round: {$Rotate: 0.5}},
                //Rotate Zoom+ out R
                {$Duration: 1000, $Zoom: 11, $Rotate: true, $SlideOut: true, $FlyDirection: 2, $Easing: {$Left: $JssorEasing$.$EaseInExpo, $Zoom: $JssorEasing$.$EaseInExpo, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInExpo}, $ScaleHorizontal: 4, $Opacity: 2, $Round: {$Rotate: 0.8}},
                //Rotate Zoom- in R
                {$Duration: 1200, $Zoom: 1, $Rotate: true, $During: {$Left: [0.2, 0.8], $Zoom: [0.2, 0.8], $Rotate: [0.2, 0.8]}, $FlyDirection: 2, $Easing: {$Left: $JssorEasing$.$EaseSwing, $Zoom: $JssorEasing$.$EaseSwing, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseSwing}, $ScaleHorizontal: 0.6, $Opacity: 2, $Round: {$Rotate: 0.5}},
                //Rotate Zoom+ out L
                {$Duration: 1000, $Zoom: 11, $Rotate: true, $SlideOut: true, $FlyDirection: 1, $Easing: {$Left: $JssorEasing$.$EaseInExpo, $Zoom: $JssorEasing$.$EaseInExpo, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInExpo}, $ScaleHorizontal: 4, $Opacity: 2, $Round: {$Rotate: 0.8}},
                //Rotate HDouble- in
                {$Duration: 1200, $Cols: 2, $Zoom: 1, $Rotate: true, $FlyDirection: 5, $Assembly: 2049, $ChessMode: {$Column: 15}, $Easing: {$Left: $JssorEasing$.$EaseInCubic, $Top: $JssorEasing$.$EaseInCubic, $Zoom: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseOutQuad, $Rotate: $JssorEasing$.$EaseInCubic}, $ScaleHorizontal: 0.5, $ScaleVertical: 0.3, $Opacity: 2, $Round: {$Rotate: 0.7}},
                //Rotate HDouble- out
                {$Duration: 1000, $Cols: 2, $Zoom: 1, $Rotate: true, $SlideOut: true, $FlyDirection: 5, $Assembly: 2049, $ChessMode: {$Column: 15}, $Easing: {$Left: $JssorEasing$.$EaseInExpo, $Top: $JssorEasing$.$EaseInExpo, $Zoom: $JssorEasing$.$EaseInExpo, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInExpo}, $ScaleHorizontal: 0.5, $ScaleVertical: 0.3, $Opacity: 2, $Round: {$Rotate: 0.7}},
                //Rotate VFork in
                {$Duration: 1200, $Rows: 2, $Zoom: 11, $Rotate: true, $FlyDirection: 6, $Assembly: 2049, $ChessMode: {$Row: 28}, $Easing: {$Left: $JssorEasing$.$EaseInCubic, $Top: $JssorEasing$.$EaseInCubic, $Zoom: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseOutQuad, $Rotate: $JssorEasing$.$EaseInCubic}, $ScaleHorizontal: 4, $ScaleVertical: 2, $Opacity: 2, $Round: {$Rotate: 0.7}},
                //Rotate HFork in
                {$Duration: 1200, $Cols: 2, $Zoom: 11, $Rotate: true, $FlyDirection: 5, $Assembly: 2049, $ChessMode: {$Column: 19}, $Easing: {$Left: $JssorEasing$.$EaseInCubic, $Top: $JssorEasing$.$EaseInCubic, $Zoom: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseOutQuad, $Rotate: $JssorEasing$.$EaseInCubic}, $ScaleHorizontal: 1, $ScaleVertical: 2, $Opacity: 2, $Round: {$Rotate: 0.8}}
            ];
            var galleryPhotoOptions = {
                $AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
                $AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
                $PauseOnHover: 3, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, default value is 3

                $DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
                $ArrowKeyNavigation: true, //[Optional] Allows keyboard (arrow key) navigation or not, default value is false
                $SlideDuration: 600, //Specifies default duration (swipe) for slide in milliseconds

                $SlideshowOptions: {//[Optional] Options to specify and enable slideshow or not
                    $Class: $JssorSlideshowRunner$, //[Required] Class to create instance of slideshow
                    $Transitions: _SlideshowTransitions, //[Required] An array of slideshow transitions to play slideshow
                    $TransitionsOrder: 1, //[Optional] The way to choose transition to play slide, 1 Sequence, 0 Random
                    $ShowLink: false       //[Optional] Whether to bring slide link on top of the slider when slideshow is running, default value is false
                },
                $DirectionNavigatorOptions: {//[Optional] Options to specify and enable direction navigator or not
                    $Class: $JssorDirectionNavigator$, //[Requried] Class to create direction navigator instance
                    $ChanceToShow: 1, //[Required] 0 Never, 1 Mouse Over, 2 Always
                    $AutoCenter: 2, //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
                    $Steps: 1                                       //[Optional] Steps to go for each navigation request, default value is 1
                },
                $ThumbnailNavigatorOptions: {//[Optional] Options to specify and enable thumbnail navigator or not
                    $Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
                    $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always

                    $ActionMode: 1, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1
                    $Lanes: 2, //[Optional] Specify lanes to arrange thumbnails, default value is 1
                    $SpacingX: 10, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
                    $SpacingY: 10, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
                    $DisplayPieces: 5, //[Optional] Number of pieces to display, default value is 1
                    $ParkingPosition: 156, //[Optional] The offset position to park thumbnail
                    $Orientation: 2                                //[Optional] Orientation to arrange thumbnails, 1 horizental, 2 vertical, default value is 1
                }
            };
            var GalleryPhoto = new $JssorSlider$("GalleryPhoto", galleryPhotoOptions);
            //responsive code begin
            //you can remove responsive code if you don't want the slider scales while window resizes
            function ScaleGalleryPhoto() {
                var parentWidth = GalleryPhoto.$Elmt.parentNode.clientWidth;

                if (parentWidth)
                    GalleryPhoto.$SetScaleWidth(Math.max(Math.min(parentWidth, 960), 300));
                else
                    window.setTimeout(ScaleGalleryPhoto, 1000);
            }
            ScaleGalleryPhoto();
            //if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) {
            $(window).bind('resize', ScaleGalleryPhoto);
            //}
        } catch (e) {

        }
    //responsive code end
    //END GALLERY PHOTO--->

    //<<<---START GRID GALLERY
    if ($('#GalleryGrid').length > 0)
        try {
            var nestedSliders = [];
            var pie = 0;
            $.each(["GalleryRow0", "GalleryRow1", "GalleryRow2", "GalleryRow3"], function(index, value) {
                if ($('#' + value).length > 0) {
                    var speed = Math.random() * (5000 - 3000) + 3000;
                    var sliderhOptions = {
                        $AutoPlay: true,
                        $AutoPlayInterval: speed,
                        $LazyLoading: 3,
                        $PauseOnHover: 3, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, default value is 3
                        $SlideDuration: 300, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
                        $MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide , default value is 20
                        $SlideWidth: 202, //[Optional] Width of every slide in pixels, default value is width of 'slides' container
                        //$SlideHeight: 120,                                  //[Optional] Height of every slide in pixels, default value is height of 'slides' container
                        $SlideSpacing: 8, //[Optional] Space between each slide in pixels, default value is 0
                        $DisplayPieces: 4, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
                        $ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
                        $UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, direction navigator container, thumbnail navigator container etc).


                    };
                    var jssor_sliderh = new $JssorSlider$(value, sliderhOptions);
//                var ignore_ = false;
                    jssor_sliderh.$On($JssorSlider$.$EVT_CLICK, function(slideIndex, event) {
                        $('#' + value + ' div[u="slides"] div a').eq(slideIndex).click();
                    });
//                jssor_sliderh.$On($JssorSlider$.$EVT_DRAG_START,function(position,virtualPosition,event){
//                    ignore_ = true;
//                });
                    jssor_sliderh.$On($JssorSlider$.$EVT_DRAG_END, function(position, startPosition, virtualPosition, virtualStartPosition, event) {
                        event.preventdefault();
                        return  false;
                    });

                }
            });

            var galleryGridOptions = {
                $AutoPlay: true,
                $AutoPlayInterval: 4000, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
                $AutoPlaySteps: 1, //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1
                $AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
                        $PauseOnHover: 3, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, default value is 3

                $ArrowKeyNavigation: false, //[Optional] Allows keyboard (arrow key) navigation or not, default value is false
                $SlideDuration: 300, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
                $MinDragOffsetToSlide: 80, //[Optional] Minimum drag offset to trigger slide , default value is 20
                //$SlideWidth: 600,                                 //[Optional] Width of every slide in pixels, default value is width of 'slides' container
                $SlideHeight: 120, //[Optional] Height of every slide in pixels, default value is height of 'slides' container
                $SlideSpacing: 8, //[Optional] Space between each slide in pixels, default value is 0
                $DisplayPieces: 2, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
                $ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
                $UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, direction navigator container, thumbnail navigator container etc).
                $PlayOrientation: 2, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, default value is 1
                $DragOrientation: 2, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0),


            };
            var GalleryGrid = new $JssorSlider$("GalleryGrid", galleryGridOptions);
            //responsive code begin
            //you can remove responsive code if you don't want the slider scales while window resizes
            function ScaleGridGallery() {
                var parentWidth0 = GalleryGrid.$Elmt.parentNode.clientWidth;
                if (parentWidth0) {
                    var winw = $(window).width();
                    if (winw < 480) {
                        parentWidth0 += parentWidth0;
                    } else if (winw < 620) {
                        parentWidth0 += parentWidth0 * 33.333333333 / 100
                    }

                    GalleryGrid.$SetScaleWidth(parentWidth0);
                } else
                    window.setTimeout(ScaleGridGallery, 1000);
            }
            //Scale slider immediately
            ScaleGridGallery();
            var tScaleGridGallery = function() {
            };
            //if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) {
//            $( window ).resize(function(){
//                clearTimeout(tScaleGridGallery);
//                tScaleGridGallery=setTimeout(ScaleGridGallery,1000);
//            });
            $(window).bind('resize', ScaleGridGallery);
            //}
        } catch (e) {
            //console.log(e.message);
        }
    //responsive code end
    //END GRID GALLERY --->>>


    //<<<---START SLIDERTOP
    try {

        
        var sliderTopOptions = {
            $AutoPlay: false, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
            $AutoPlaySteps: 1, //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1
            $AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
            $PauseOnHover: 0, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, default value is 3

            $ArrowKeyNavigation: true, //[Optional] Allows keyboard (arrow key) navigation or not, default value is false
            $SlideDuration: 500, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
            $MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide , default value is 20
            //$SlideWidth: 600,                                 //[Optional] Width of every slide in pixels, default value is width of 'slides' container
            //$SlideHeight: 300,                                //[Optional] Height of every slide in pixels, default value is height of 'slides' container
            $SlideSpacing: 0, //[Optional] Space between each slide in pixels, default value is 0
            $DisplayPieces: 1, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
            $ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
            $UISearchMode: 1, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, direction navigator container, thumbnail navigator container etc).
            $PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, default value is 1
            $DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)

            $DirectionNavigatorOptions: {
                $Class: $JssorDirectionNavigator$, //[Requried] Class to create direction navigator instance
                $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
                $Steps: 1                                       //[Optional] Steps to go for each navigation request, default value is 1
            },
            $ThumbnailNavigatorOptions: {
                $Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
                $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always

                $ActionMode: 1, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1
                $AutoCenter: 3, //[Optional] Auto center thumbnail items in the thumbnail navigator container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 3
                $Lanes: 1, //[Optional] Specify lanes to arrange thumbnails, default value is 1
                $SpacingX: 0, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
                $SpacingY: 0, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
                $DisplayPieces: 3, //[Optional] Number of pieces to display, default value is 1
                $ParkingPosition: 200, //[Optional] The offset position to park thumbnail
                $Orientation: 1, //[Optional] Orientation to arrange thumbnails, 1 horizental, 2 vertical, default value is 1
                $DisableDrag: false //[Optional] Disable drag or not, default value is false
            }
        };
        var SliderTop;//= new $JssorSlider$('SliderTop', sliderTopOptions);
        var SliderTopContent = $('#SliderTop').html();
        
        //responsive code begin
        //you can remove responsive code if you don't want the slider scales while window resizes
        function ScaleSliderTop() {
            //if (navigator.userAgent.match(/(Linux)/)) {
                var np_width = $('#SliderTop').parent().width();
                var np_height = $('#SliderTop').parent().height();
                $('#SliderTop').html(SliderTopContent);
                $('#SliderTop,#SliderTop>div[u="slides"]').css({
                    width: np_width,
                    height: np_height
                });
                if(np_width>480){
                    sliderTopOptions.$ThumbnailNavigatorOptions = {
                        $Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
                        $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always

                        $ActionMode: 1, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1
                        $AutoCenter: 3, //[Optional] Auto center thumbnail items in the thumbnail navigator container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 3
                        $Lanes: 1, //[Optional] Specify lanes to arrange thumbnails, default value is 1
                        $SpacingX: 0, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
                        $SpacingY: 0, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
                        $DisplayPieces: 3, //[Optional] Number of pieces to display, default value is 1
                        $ParkingPosition: 200, //[Optional] The offset position to park thumbnail
                        $Orientation: 1, //[Optional] Orientation to arrange thumbnails, 1 horizental, 2 vertical, default value is 1
                        $DisableDrag: false //[Optional] Disable drag or not, default value is false
                    };
                    sliderTopOptions.$NavigatorOptions = null;
                    var nw_thumbs = $('#SliderTop div.jssorthumbs[u="thumbnavigator"]').width();
                    if(Math.floor(nw_thumbs/3)>160){
                        $('#SliderTop div.jssorthumbs[u="thumbnavigator"] div[u="prototype"],#SliderTop div.jssorthumbs[u="thumbnavigator"] div[u="prototype"] ThumbnailTemplate').css({
                            width: Math.floor(nw_thumbs/3)
                        });
                        sliderTopOptions.$ThumbnailNavigatorOptions.$ParkingPosition = Math.floor(nw_thumbs/3);
                        sliderTopOptions.$ThumbnailNavigatorOptions.$DisplayPieces = 3;
                    }else{
                        $('#SliderTop div.jssorthumbs[u="thumbnavigator"] div[u="prototype"],#SliderTop div.jssorthumbs[u="thumbnavigator"] div[u="prototype"] ThumbnailTemplate').css({
                            width: Math.floor(nw_thumbs/2)
                        });
                        sliderTopOptions.$ThumbnailNavigatorOptions.$ParkingPosition = Math.floor(nw_thumbs/2);
                        sliderTopOptions.$ThumbnailNavigatorOptions.$DisplayPieces = 2;
                    }
                }else{
                    $('#SliderTop div.jssorthumbs[u="thumbnavigator"]').replaceWith('<div u="navigator" class="slider1-N" style="position: absolute; bottom: 4px; right: 4px;">\
                        <div u="prototype" style="POSITION: absolute; WIDTH: 12px; HEIGHT: 12px;"></div>\
                    </div>');
                    sliderTopOptions.$ThumbnailNavigatorOptions = null;
                    sliderTopOptions.$NavigatorOptions = {                                //[Optional] Options to specify and enable navigator or not
                        $Class: $JssorNavigator$,                       //[Required] Class to create navigator instance
                        $ChanceToShow: 2,                               //[Required] 0 Never, 1 Mouse Over, 2 Always
                        $AutoCenter: 1,                                 //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
                        $Steps: 1,                                      //[Optional] Steps to go for each navigation request, default value is 1
                        $Lanes: 1,                                      //[Optional] Specify lanes to arrange items, default value is 1
                        $SpacingX: 10,                                   //[Optional] Horizontal space between each item in pixel, default value is 0
                        $SpacingY: 10,                                   //[Optional] Vertical space between each item in pixel, default value is 0
                        $Orientation: 1                                 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1
                    };
                }
                SliderTop = new $JssorSlider$('SliderTop', sliderTopOptions);
                $('#SliderTop .nailthumb .nailthumb-figure .nailthumb-container').nailthumb();
            //} else {
            //    ScaleSliderTop();
            //}

        }
        //if (!navigator.userAgent.match(/(Linux)/)) {
            ScaleSliderTop();
        //}
        var tScaleSliderTop = function() {
        };
        //if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) {
        $(window).bind('resize', ScaleSliderTop);
        //}
        //$JssorPlayer$.$FetchPlayers(document.body);
    } catch (e) {

    }
    //responsive code end
    //END SLIDERTOP--->>>

    try {
        $(window).scroll(function() {
            var st = $(window).scrollTop();
            if (st > 280) {
                $('.gototop').stop().show().animate({'margin-top': st + 100}, 1000);
            } else
                $('.gototop').stop().hide();
        });
        $('.gototop,.gototopnavicon').click(function() {
            $('body,html').animate({scrollTop: 0}, 1000);
        });
    } catch (e) {
    }
    try {
        $("img.lazy-auto").lazyload();
        $("img.lazybg").lazyload({skip_invisible: false});
        $("img.lazy").lazyload({
            load: function() {
                try {
                    $(this).removeClass('lazy');
                    if (!mobile_detect.isMobile)
                        $(this.parentNode).nailthumb();
                } catch (e) {
                }
            }
        });
        
    } catch (e) {
    }
    try {
//        $('.other-menu').click(function(e) {
//            $('.dropdown-toggle.primary-menu').click();
//            return false;
//        });
        $('.metro-icon.pull-right').click(function() {
            $('.menu-bottom').stop().animate({'margin-bottom': -60}, 500, function() {
                $(this).toggleClass('unactive').animate({'margin-bottom': 0}, 500);
            });
        });
    } catch (e) {
    }
    try {
        if ($("a.swipebox").length > 0) {
            $("a.swipebox").swipebox({
                useCSS: true, // false will force the use of jQuery for animations
                hideBarsDelay: 0 // 0 to always show caption and action bar
            });
        }
    } catch (e) {
    }

    $('#newsevent-prev').click(function() {
        $('#carousel-example-generic').carousel('prev');
        setTimeout(function() {
            $("#carousel-example-generic .item.active img.lazy").lazyload({
                load: function() {
                    $(this.parentNode).nailthumb();
                }
            });
        }, 1000);
    });
    $('#newsevent-next').click(function() {
        $('#carousel-example-generic').carousel('next');
        setTimeout(function() {
            $("#carousel-example-generic .item.active img.lazy").lazyload({
                load: function() {
                    $(this.parentNode).nailthumb();
                }
            });
        }, 1000);
    });
    //if(!mobile_detect.isMobile)
    //$("#download-modal").niceScroll('.modal-dialog',{cursoropacitymax:0.4,touchbehavior:false});
});
function loadOtherRelated(url) {
    $('.news-related-list .other-news-related')
            .removeClass('other-news-related')
            .load(url);
}